#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MOVIES 50
#define USERS 500

#define DATALINES 9997


int main(int argc, char *argv[]) {
	FILE *in;
	int u, i;
	int user, movie, rating;
	
	int ratings[USERS][MOVIES];
	
	memset(ratings, '\0', sizeof(ratings));
	
	//
	// read in
	//
	in = fopen(argv[1], "r");
	
	while ( fscanf(in, "%d,%d,%d", &user, &movie, &rating) != EOF ) {
		ratings[user][movie] = rating;
	}
	
	for (u = 0; u < USERS; u++) {
		for (i = 0; i < MOVIES; i++) {
			if (ratings[u][i])
				printf("%d", ratings[u][i]);
			else
				printf("-");
			
			if (i != MOVIES - 1)
				printf(",");
		}
		printf("\n");
	}
	return 0;
}